package concurrent;

import java.lang.reflect.Method;

/**
 * @package concurrent
 * @Class MutilThread
 * @Description TODO
 * @Author zhangxinhua
 * @Date 20-1-15 下午5:02
 */
public class MutilThread implements Runnable{

    public static void main(String[] args)  {

    }

    @Override
    public void run() {
        try {
            String name = Thread.currentThread().getName();
            Class<ChuanDi> claszz = ChuanDi.class;
            ChuanDi chuanDi = claszz.newInstance();
            System.out.println(name);
            Method test = claszz.getMethod("test");
            Object invoke = test.invoke(chuanDi);
            System.out.println(invoke);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
